package com.bdqn.controller;

import com.bdqn.pojo.Patient;
import com.bdqn.service.PatientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@CrossOrigin
@RequestMapping("patient")
public class PatientController {
    @Autowired
    PatientService patientService;

    //根据身份证查看患者信息
    @GetMapping("/getPatient")
    public Patient getPatient(String idCard){
        Patient patient=patientService.getPatient(idCard);
        return patient;
    }

    //添加患者
    @PostMapping("/AddPatient")
    public int AddPatient(@RequestBody Patient patient){
        int row=patientService.addPatient(patient);
        return row;
    }
}
